package com.youbug.kefu.entity;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;

import com.youbug.system.config.annotation.UseDicTrans;
import com.youbug.system.config.coverter.DicCoverter;
import com.youbug.common.constant.DicTypeContent;
import com.youbug.common.config.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.websocket.Session;

/**
 * <p>
 * 会话表
 * </p>
 *
 * @author youbug
 * @since 2023-01-07
 */
@ApiModel(value="Chat对象", description="会话表")
@ExcelIgnoreUnannotated
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
public class Chat extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "会话类型 0电脑端，1移动端")
    @ExcelProperty(value = "会话类型", converter = DicCoverter.class)
    @UseDicTrans(dicTypeCode = DicTypeContent.CHAT_TYPE)
    private String type;

    @ApiModelProperty(value = "坐席id")
    private Long agentId;

    @ApiModelProperty(value = "坐席姓名")
    @ExcelProperty("坐席姓名")
    private String agentName;

    @ApiModelProperty(value = "客户id")
    private Long clientId;

    @ApiModelProperty(value = "客户姓名")
    @ExcelProperty("客户姓名")
    private String clientName;

    @ApiModelProperty(value = "状态，0等待，1通话，2结束")
    private Integer state;

    @ApiModelProperty(value = "满意度，10分最高,0分最低")
    @ExcelProperty("评分")
    private Integer satisfaction;

    @ApiModelProperty(value = "开始时间")
    @ExcelProperty("开始时间")
    @DateTimeFormat("yyy-MM-dd HH:mm:ss")
    @ColumnWidth(20)
    private LocalDateTime beginTime;

    @ApiModelProperty(value = "接起时间")
    @ExcelProperty("接起时间")
    @DateTimeFormat("yyy-MM-dd HH:mm:ss")
    @ColumnWidth(20)
    private LocalDateTime answerTime;

    @ApiModelProperty(value = "结束时间")
    @ExcelProperty("结束时间")
    @DateTimeFormat("yyy-MM-dd HH:mm:ss")
    @ColumnWidth(20)
    private LocalDateTime endTime;

    @TableField(exist = false)
    private Session clientSession;

    @TableField(exist = false)
    private Session agentSession;


    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getSatisfaction() {
        return satisfaction;
    }

    public void setSatisfaction(Integer satisfaction) {
        this.satisfaction = satisfaction;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getAgentId() {
        return agentId;
    }

    public void setAgentId(Long agentId) {
        this.agentId = agentId;
    }

    public String getAgentName() {
        return agentName;
    }

    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }

    public Long getClientId() {
        return clientId;
    }

    public void setClientId(Long clientId) {
        this.clientId = clientId;
    }

    public String getClientName() {
        return clientName;
    }

    public void setClientName(String clientName) {
        this.clientName = clientName;
    }

    public LocalDateTime getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(LocalDateTime beginTime) {
        this.beginTime = beginTime;
    }

    public LocalDateTime getAnswerTime() {
        return answerTime;
    }

    public void setAnswerTime(LocalDateTime answerTime) {
        this.answerTime = answerTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public Session getClientSession() {
        return clientSession;
    }

    public void setClientSession(Session clientSession) {
        this.clientSession = clientSession;
    }

    public Session getAgentSession() {
        return agentSession;
    }

    public void setAgentSession(Session agentSession) {
        this.agentSession = agentSession;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }
}
